import java.util.HashSet;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:
 * Date: 2024-10-20
 * Time: 11:29
 */
public class Test {
    public static void main(String[] args) {
        HashSet<Integer> set = new HashSet<>();
        int[] array = {1,2,3,4,5,6,7,1,2,3,5,89,5,2,4,5,24,8,5,2,};
        for (int i = 0; i < array.length; i++) {
            if(!set.contains(array[i])){
                set.add(array[i]);
            }else{
                System.out.println(array[i]);
                return;
            }
        }
    }


    // 统计 一篇 英文阅读中 每个单词 出现的次数
    //参数：String[]
}
